<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>我的题库</title>
    <link rel="icon" href="${ pageContext.request.contextPath}/assets/images/favicon.ico" type="image/ico">
    <link href="${ pageContext.request.contextPath}/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/assets/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/assets/css/style.css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/assets/css/searchable-select.css" rel="stylesheet">
    <link rel="stylesheet" href="${ pageContext.request.contextPath}/assets/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css">
    <script type="text/javascript" src="${ pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ pageContext.request.contextPath}/assets/js/jquery.form.js"></script>
    <script type="text/javascript" src="${ pageContext.request.contextPath}/assets/js/searchable-select.js"></script>
    <script type="text/javascript" src="${ pageContext.request.contextPath}/project/js/edit.js"></script>
    <%--    全局主题配置--%>
    <link href="${ pageContext.request.contextPath}/assets/codeying.css" rel="stylesheet">
    <script type="text/javascript" src="${ pageContext.request.contextPath}/assets/theme.js"></script>
    <script>
        $(function (){
            activeBar("nav_questionBank")
        })
    </script>
</head>
<%--translucent--%>
<%--dark--%>
<body  data-theme="default">
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    
    <!-- 页面头部 -->
    <jsp:include page="../header.jsp"></jsp:include>
    <!-- 导航侧栏 -->
    <jsp:include page="../sidebar.jsp"></jsp:include>
    
    <!--页面主要内容-->
    <main class="lyear-layout-content">
    
    <div class="container-fluid">
      
      <div class="row">
        <div class="col-lg-12">
          <div class="card">
            <div class="card-header">
              <h4>我的题库信息管理</h4>
              <a href="list" style="color: cornflowerblue;float: right">返回</a>
            </div>
            <div class="card-body">
              <form autocomplete="off" enctype="multipart/form-data" id="editForm" class="form-horizontal"
                action="${ pageContext.request.contextPath}/questionBank/save" method="post">
                <div class="row">
                  
                  <c:if test="${ sessionScope.user.role.equalsIgnoreCase('user')}">
                    <input readonly type="hidden" name="userid" value="${ sessionScope.user.id }">
                  </c:if>
                  <c:if test="${ !sessionScope.user.role.equalsIgnoreCase('user')}">
                    
                    <div class="form-group col-md-6 col-lg-4">
                      <label class="col-xs-12">用户</label>
                      <div class="col-xs-12">
                        <select class="form-control" name="userid" id="userid2">
                          <option value="">请选择用户</option>
                          <c:forEach items="${ useridFrnList }" var="i" varStatus="s">
                            <option <c:if test="${ item.userid == i.id }">selected</c:if> value="${ i.id}">${ i.username }</option>
                          </c:forEach>
                        </select>
                        <script>
                                                    $('#userid2').searchableSelect();
                                                </script>
                        </div>
                    </div>
                    
                  </c:if> <div class="form-group col-md-6 col-lg-4">
                    <label class="col-xs-12" >题目名</label>
                    <div class="col-xs-12">
                      <input required maxlength="255" class="form-control"
                      type="text" name="name" placeholder="请输入题目名" value="${ item.name }">
                    </div>
                  </div>
                  <div class="form-group col-md-12 col-lg-12">
                    <label class="col-xs-12">题目内容</label>
                    <div class="col-xs-12">
                      <textarea required class="form-control" style="height: 120px"
                      name="content" placeholder="请输入题目内容">${ item.content }</textarea>
                    </div>
                  </div>
                  <div class="form-group col-md-6 col-lg-4">
                    <label class="col-xs-12" >题目答案</label>
                    <div class="col-xs-12">
                      <input required maxlength="255" class="form-control"
                      type="text" name="answer" placeholder="请输入题目答案" value="${ item.answer }">
                    </div>
                  </div>
                  <div class="form-group col-md-6 col-lg-4">
                    <label class="col-xs-12" >知识点</label>
                    <div class="col-xs-12">
                      <input required maxlength="255" class="form-control"
                      type="text" name="labels" placeholder="请输入知识点" value="${ item.labels }">
                    </div>
                  </div>
                  
                  <div class="form-group col-md-12 col-lg-12">
                    <input class="btn btn-primary" value="确认" type="submit">
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
      
    </div>
    
    </main>
    <!--End 页面主要内容-->
  </div>
</div>
<script type="text/javascript" src="${ pageContext.request.contextPath}/assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${ pageContext.request.contextPath}/assets/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="${ pageContext.request.contextPath}/assets/js/main.min.js"></script>
<%--时间选择的插件--%>
<script src="${ pageContext.request.contextPath}/assets/js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="${ pageContext.request.contextPath}/assets/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="${ pageContext.request.contextPath}/assets/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>
</body>
</html>

